conda和pip下载速度太慢?添加镜像 您所在的位置:网站首页 r markdown下载太慢 conda和pip下载速度太慢?添加镜像

conda和pip下载速度太慢?添加镜像

2023-05-29 03:25| 来源: 网络整理| 查看: 265

conda

使用Anaconda安装第三方库的时候,默认下载网站在国外,因此下载速度很慢,可以添加国内镜像源提高下载速度。

1、添加清华镜像源 如遇镜像源网站失效,可以自行前往清华大学开源软件镜像站 | Tsinghua Open Source Mirror获取网址。

# 添加清华镜像源 conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/ # 搜索时显示地址 conda config --set show_channel_urls yes

2、查看conda通道的配置

显示conda所有通道:

conda config --show channels

如果通道中含有defaults需要删掉,这样在下载时会默认使用清华镜像源:

conda config --remove channels defaults

3、重置通道设置 如果想要删除添加的所有镜像源,重置conda默认源,可以使用以下语句:

conda config --remove-key channels pip

1、添加源

比如添加清华源 https://pypi.tuna.tsinghua.edu.cn/simple:

pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

如果set多次,只能保存最后一次set的镜像源。

2、删除源

pip config unset global.index-url

3、查看现在用的哪个源

pip config list


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有